<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            background-color: black;
        }

        .container {
            width: 300px;
            height: 300px;
            margin: 50px;
        }

        .person {
            position: absolute;
            left: 150px;
            top: 160px;
            animation: sprint 4s infinite ease-in;
        }

        .head {
            position: absolute;
            top: -30px;
            left: -6px;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            border: 10px solid white;
            animation: bob 2s infinite alternate;
        }

        .torso {
            width: 0;
            height: 60px;
            border-left: 10px solid white;
            position: absolute;
            top: 16px;
            left: 0px;
        }

        .person .part {
            position: absolute;
            left: 10px;
            top: 75px;

        }

        .person .part.arm {
            width: 40px;
            height: 45px;
            border-left: 10px solid white;
            border-bottom: 10px solid white;
            position: absolute;
            top: 20px;

            transform-origin:0% 0% 0px;
            animation: pump 1s infinite ease-in-out;

        }
        .person .part.arm.one{
            transform:rotate3d(0,0,1,80deg);
        }

        .person .part.arm.two{
            transform:rotate3d(0,0,1,-70deg);
            animation-delay: 0.5s;
        }

        .person .part.leg {
            height:60px;
            width:60px;
            border-right:10px solid white;
            border-top:10px solid white;
            transform-origin:0% 0% 0px;
            animation: run 1s infinite ease-in-out;
        }

        .person .part.leg.one{
            transform:rotate3d(0,0,1,100deg);
        }

        .person .part.leg.two{
            transform:rotate3d(0,0,1,10deg);
            animation-delay: 0.5s;
        }
        /* 头部动起来 */
        @keyframes bob {
            0% {
                transform: rotate3d(0,0,1,5deg);
            }
            25% {
                transform: rotate3d(0,0,1,-30deg) skew(15deg,0deg);
            }
            50% {
                transform: rotate3d(0,0,1,5deg);
            }
            75% {
                transform: rotate3d(0,0,1,-30deg) skew(15deg,0deg);
            }
            100% {
                transform: rotate3d(0,0,1,20deg) skew(-15deg,0deg);
            }
            

        }

        /* 胳臂摆动起来 */
        @keyframes pump{
            0%{
                transform:rotate3d(0,0,1,80deg);
            }
            50%{
                transform:rotate3d(0,0,1,-70deg);
            }
            100%{
                transform:rotate3d(0,0,1,80deg);
            }
        }
        /* 腿部跑起来 */
        @keyframes run{
            0%{
                transform:rotate3d(0,0,1,-5deg);
            }
            50%{
                transform:rotate3d(0,0,1,150deg);
            }
            100%{
                transform:rotate3d(0,0,1,-5deg);
            }
        }
         /* 让人跑起来 */
         @keyframes sprint{
            0%{
                transform:translate(-200px,0px);
            }
            100%{
                transform:translate(2300px,0px);
            }
        }
    </style>
</head>

<body>
    <!-- 火柴人结构 -->
    <div class="container">
        <div class="person">
            <div class="head"></div>
            <div class="part arm one"></div>
            <div class="part arm two"></div>
            <div class="torso"></div>
            <div class="part leg one"></div>
            <div class="part leg two"></div>
        </div>
    </div>
</body>

</html>